'use strict';
/**
 * @fileoverview 激活码
 * @author sundbcn@gmail.com (sun debing)
 */

var mongoose = require('mongoose');
var _ = require('lodash');

/**
 * 激活码
 */
var cdkItemSchema = new mongoose.Schema({
    // 激活码类型列表
    cdk_type: {
        type: Number,
        default: 0
    },

    // 限制使用次数
    use_times: {
        type: Number,
        default: 0
    }
});

if (!cdkItemSchema.options.toJSON) {
    cdkItemSchema.options.toJSON = {};
}
/* jshint unused:false */
cdkItemSchema.options.toJSON.transform = function (doc, ret) {
    delete ret._id;
    delete ret.__v;
};

module.exports = cdkItemSchema;
